package com.wlanauth.web.action;

import org.hibernate.criterion.Restrictions;

import com.wlanauth.core.criteria.GeneralCriteria;
import com.wlanauth.core.criteria.GeneralCriteriaResult;
import com.wlanauth.domain.manage.UploadFileLog;
import com.wlanauth.web.core.BaseActionSupport;
import com.wlanauth.web.core.JsonResult;
/**
 * 用户上载文件
 * @author zz
 * @date 2012-5-26
 * @email charles.zz.life@gmail.com
 */
public class UploadFileLogAction extends BaseActionSupport {
	
	private static final long serialVersionUID = 1L;
	
	private UploadFileLog entity;
	
	public String list(){
		GeneralCriteria criteria = this.buildWebQueryCriteria(UploadFileLog.class);
		if(entity!=null){
			if(entity.getLineNum()!=null){
				criteria.add(Restrictions.eq("lineNum", entity.getLineNum()));
			}
			if(entity.getType()!=null){
				criteria.add(Restrictions.eq("type", entity.getType()));
			}
			if(entity.getUploadFileId()!=null){
				criteria.add(Restrictions.eq("uploadFileId", entity.getUploadFileId()));
			}
		}
		
		GeneralCriteriaResult<UploadFileLog> result = criteria.executeQuery();
		
		this.jsonResult = new JsonResult(this,result.getData(),result.getTotal());
		return this.actionJsonResult();
	}

	public UploadFileLog getEntity() {
		return entity;
	}

	public void setEntity(UploadFileLog entity) {
		this.entity = entity;
	}

}
